package cn.com.lyj6851;

import org.apache.catalina.filters.RequestDumperFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
 * 认证服务器
 * @author Administrator
 *
 */

@SpringBootApplication
public class SsoServiceApplication {
	public static void main(String[] args) {
        SpringApplication.run(SsoServiceApplication.class, args);
    }
	@Bean
	public PasswordEncoder passwordEncoder(){
	    return PasswordEncoderFactories.createDelegatingPasswordEncoder();
	}
	/**
     * 为测试环境添加相关的 Request Dumper information，便于调试
     * @return
     */
    @Profile("!cloud")
    @Bean
    RequestDumperFilter requestDumperFilter() {
        return new RequestDumperFilter();
    }
}
